import server from '@/utils/request'

// 获取菜品列表
export function getDishList({ page, name, categoryId }) {
    return server({
        url: '/dish',
        method: 'get',
        params: {
            page: page || 1,
            name,
            categoryId,
        }
    })
}

// 添加菜品
export function addDish(dish){
    return server({
        url: '/dish',
        method: 'post',
        data: dish
    })
}

// 删除菜品
export function deleteDish(id){
    return server({
        url: `/dish/${id}`,
        method: 'delete'
    })
}

// 更新菜品
export function updateDish(dish) {
    return server({
        url: '/dish',
        method: 'put',
        data: dish
    })
}


